package com.ruoyi.staff.service.impl;

import java.util.List;

import com.ruoyi.common.utils.RandomUtils;
import com.ruoyi.staff.domain.ro.StaffRo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.staff.mapper.EpStaffMapper;
import com.ruoyi.staff.domain.EpStaff;
import com.ruoyi.staff.service.IEpStaffService;

/**
 * 员工表Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-09
 */
@Service
public class EpStaffServiceImpl implements IEpStaffService 
{
    @Autowired
    private EpStaffMapper epStaffMapper;

    /**
     * 查询员工表
     * 
     * @param id 员工表主键
     * @return 员工表
     */
    @Override
    public EpStaff selectEpStaffById(Long id)
    {
        return epStaffMapper.selectEpStaffById(id);
    }

    /**
     * 查询员工表列表
     * 
     * @param epStaff 员工表
     * @return 员工表
     */
    @Override
    public List<EpStaff> selectEpStaffList(EpStaff epStaff)
    {
        return epStaffMapper.selectEpStaffList(epStaff);
    }

    /**
     * 新增员工表
     * 
     * @param epStaff 员工表
     * @return 结果
     */
    @Override
    public int insertEpStaff(EpStaff epStaff)
    {
        epStaff.setWorkId(Long.valueOf(RandomUtils.generateUniqueNumber()));
        return epStaffMapper.insertEpStaff(epStaff);
    }

    /**
     * 修改员工表
     * 
     * @param epStaff 员工表
     * @return 结果
     */
    @Override
    public int updateEpStaff(EpStaff epStaff)
    {
        return epStaffMapper.updateEpStaff(epStaff);
    }

    /**
     * 批量删除员工表
     * 
     * @param ids 需要删除的员工表主键
     * @return 结果
     */
    @Override
    public int deleteEpStaffByIds(Long[] ids)
    {
        return epStaffMapper.deleteEpStaffByIds(ids);
    }

    /**
     * 删除员工表信息
     * 
     * @param id 员工表主键
     * @return 结果
     */
    @Override
    public int deleteEpStaffById(Long id)
    {
        return epStaffMapper.deleteEpStaffById(id);
    }

    @Override
    public List<EpStaff> selectEpStaffRoList(StaffRo staffRo) {

        return epStaffMapper.selectEpStaffRoList(staffRo);
    }
}
